package org.zhangchao.poi.excel.common;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;

/**
 * Excel 行 实体类
 * @author zhangchao
 *
 */
public class XRow implements Row{
	
	/** 行索引 */
	private int rowNum;
	
	/** sheet */
	private Sheet sheet;
	
	/** 一行的单元格集合 */
	private List<Cell> cells = new ArrayList<Cell>();
	
	/**
	 * 无参构造方法
	 */
	public XRow() {
		super();
	}
	
	/**
	 * 构造方法
	 * @param rowNum 行索引
	 */
	public XRow(int rowNum) {
		super();
		this.rowNum = rowNum;
	}

	public int getCellsSize() {
		return cells.size();
	}
	
	public Row addCell(Cell cell){
		cells.add(cell);
		return this;
	}
	

	public List<Cell> getCells() {
		return cells;
	}

	public void setCells(List<Cell> cells) {
		this.cells = cells;
	}
	
	public void setSheet(Sheet sheet) {
		this.sheet = sheet;
	}
	
	//@Override
	public Sheet getSheet() {
		return sheet;
	}
	
	//@Override
	public Iterator<Cell> iterator() {
		return cells.iterator();
	}

	//@Override
	public Iterator<Cell> cellIterator() {
		return cells.iterator();
	}

	//@Override
	public Cell createCell(int i) {
		return null;
	}

	//@Override
	public Cell createCell(int i, int j) {
		return null;
	}

	//@Override
	public Cell getCell(int i) {
		return cells.get(i);
	}

	//@Override
	public Cell getCell(int i, MissingCellPolicy missingcellpolicy) {
		return null;
	}

	//@Override
	public short getFirstCellNum() {
		return 0;
	}

	//@Override
	public short getHeight() {
		return 0;
	}

	//@Override
	public float getHeightInPoints() {
		return 0;
	}

	//@Override
	public short getLastCellNum() {
		return (short)cells.size();
	}

	//@Override
	public int getPhysicalNumberOfCells() {
		return 0;
	}

	//@Override
	public int getRowNum() {
		return rowNum;
	}

	//@Override
	public CellStyle getRowStyle() {
		return null;
	}

	//@Override
	public boolean getZeroHeight() {
		return false;
	}

	//@Override
	public boolean isFormatted() {
		return false;
	}

	//@Override
	public void removeCell(Cell cell) {
		cells.remove(cell);
	}

	//@Override
	public void setHeight(short word0) {
		
	}

	//@Override
	public void setHeightInPoints(float f) {
		
	}

	//@Override
	public void setRowNum(int i) {
		this.rowNum = i;
	}

	//@Override
	public void setRowStyle(CellStyle cellstyle) {
		
	}

	//@Override
	public void setZeroHeight(boolean flag) {
		
	}
	
}
